﻿@{
    ViewBag.Title = "用户组管理";
    Layout = "~/Views/Shared/_ListLayout.cshtml";
}
@inherits CMSWebViewPage<object>
@section Head{

}
<div id="toolbar_groupinfo" class="datagrid-toolbar">
    @CurrentButtonTool.Create()
    <div>
        <form id="fr_search_groupinfo">
            @Html.QueryStringBox("角色名称", "GroupName")
            @Html.QueryStringBox("角色编码", "GroupCode")
            <a onclick="Search();" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true"></a>
        </form>
    </div>
</div>
<table id="dg_groupinfo" data-options="url:'/groupinfo/listjson',border:false,fit:true,fitColumns:true,toolbar:'#toolbar_groupinfo',singleSelect:true,pagination:true,pageSize:20">
    <thead>
        <tr>
            <th data-options="field:'ck',checkbox:true"></th>
            <th data-options="field:'Id',width:50,align:'center'">ID</th>
            <th data-options="field:'GroupName',width:50,align:'center'">角色名称</th>
            <th data-options="field:'GroupCode',width:50,align:'center'">角色编码</th>
            <th data-options="field:'CreateDate',width:80,formatter:JsonToDate,align:'center'">创建时间</th>
        </tr>
    </thead>
</table>
@section Bottom{
    <script type="text/javascript">
        var objBizDatagrid = new BizDatagrid('#dg_groupinfo');
        function Add() {
            objBizDatagrid.add("/groupinfo/editpage");
        }
        function UserRoleInfo() {
            var objRow = objBizDatagrid.selectRow();
            window.location.href = "/userroleinfo?TransferID=" + objRow.Id;
        }
        function EditGroupPowerInfo() {
            var objRow = objBizDatagrid.selectRow();
            window.location.href = "/groupinfo/editgrouppowerinfo?TransferID=" + objRow.Id + "&GroupName=" + objRow.GroupName;
        }
        function ViewGroupPowerInfo() {
            var objRow = objBizDatagrid.selectRow();
            window.location.href = "/groupinfo/viewgrouppowerinfo?TransferID=" + objRow.Id + "&GroupName=" + objRow.GroupName;
        }
        function Edit() {
            objBizDatagrid.edit("/groupinfo/editpage");
        }
        function SyncRedis() {
            var objRow = objBizDatagrid.selectRow();
            var objAjaxEntity = new AjaxEntity();
            objAjaxEntity.url = "/GroupInfo/SyncRedis/" + objRow.Id;
            objAjaxEntity.executing = function () {
                ShowProcess();
                return true;
            };
            objAjaxEntity.executeSuccess = function (invokeresult) {
                ShowMessage(invokeresult.ResultMessage);
                CloseProcess();
            };
            objAjaxEntity.execute();
        }
        function Search() {
            objBizDatagrid.search('#fr_search_groupinfo', '/groupinfo/listjson');
        }
        function Delete() {
            objBizDatagrid.del('/groupinfo/delete');
        }
    </script>
}
